package com.bbf.tio;

import com.bbf.tio.server.TioServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * 入口类
 * @author BBF
 */
@SpringBootApplication
public class Application {
  public static void main(String[] args) {
    SpringApplication app = new SpringApplication(Application.class);
    //强制指定，非web环境
    app.setWebEnvironment(false);
    app.run(args);
  }

  @Bean
  public TioServer socketServer9114(){
    //在9114启动tio
    return new TioServer();
  }

  @Bean
  public TioServer socketServer9115(){
    //在9115启动tio
    return new TioServer(null,9115);
  }
}
